<template>
    项目名称:<input type="text" v-model="Name">
    <input type="button" value="查询" @click="ShowInvest">
<table class="table-bordered" border="1">
    <tr>
        <td>投资项目名称</td>
        <td>投资总额度</td>
        <td>已投资金额</td>
        <td>剩余金额</td>
        <td>投资人数</td>
    </tr>
    <tr v-for="i in data">
        <td>{{ i.I_Name }}</td>
        <td>{{ i.I_Budget }}</td>
        <td>{{ i.I_Receive }}</td>
        <td>{{ i.I_Residue }}</td>
        <td>{{ i.I_Number }}</td>
        <td><a href="#">删除</a></td>
    </tr>
</table>
</template>
<script setup lang="ts">
import axios from 'axios';
import { onMounted,ref } from 'vue';
const Name=ref('')
// const info=ref(
//     {
//         I_Name:'',
//         I_Budget:'',
//         I_Receive:'',
//         I_Residue:'',
//         I_Number:'',
//     }
// )
const data:any=ref([])
onMounted(()=>{
    ShowInvest()
})
const ShowInvest=()=>{
    axios.get('https://localhost:44382/api/Invest/ShowInvest',
        {
            params:{
                I_Name:Name.value
            }
        }
    ).then(res=>{
       data.value=res.data
    }).catch(err=>{
        console.log(err);
    })
}



</script>